<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>我的购物车</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<!-- 项目前置 -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/iconfont.css">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/swiper.min.css">
<link rel="stylesheet" href="css/styles.css">
<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
<script src="js/bootstrap.min.js" charset="UTF-8"></script>
<script src="js/swiper.min.js" charset="UTF-8"></script>
<script src="js/global.js" charset="UTF-8"></script>
<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
<!-- 项目前置 -->
<script src="js/shopcart.js" charset="UTF-8"></script>


</head>

<body>
	<div class="tab-header">

		<div class="inner">
			<div class="pull-left">
				<div class="pull-left">
					嗨，欢迎来到<span class="cr">${user.uname}</span>
				</div>
				<a href="agent_level.html">网店代销</a> <a
					href="temp_article/udai_article4.html">帮助中心</a>
			</div>

			<div class="pull-right">
				<c:if test="${user==null }">
					<a href="login.jsp"><span class="cr">登录</span></a>
					<a href="login.jsp?p=register">注册</a>
				</c:if>
				<a href="udai_welcome.html">我的U袋</a> <a href="udai_order.html">我的订单</a>
				<a href="udai_integral.html">积分平台</a>
			</div>

		</div>
	</div>
	<!-- 顶部标题 -->
	<div class="bgf5 clearfix">
		<div class="top-user">
			<div class="inner">
				<a class="logo" href="toindexServlet"><img
					src="images/icons/logo.jpg" alt="XXX" class="cover"></a>
				<div class="title">购物车</div>
			</div>
		</div>
	</div>
	<div class="content clearfix bgf5">
		<section class="user-center inner clearfix">
		<div class="user-content__box clearfix bgf">
			<div class="title">购物车</div>
			<form action="" class="shopcart-form__box">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th width="150"><label class="checked-label"><input
									type="checkbox" class="check-all"
									onclick="clickall(this.checked)"><i></i> 全选</label></th>
							<th width="300">商品信息</th>
							<th width="150">单价</th>
							<th width="200">数量</th>
							<th width="200">总价</th>
							<th width="80">操作</th>

						</tr>
					</thead>
					<tbody id="mythead">
						<c:set var="sum" value="0"></c:set>
						<c:forEach items="${shops }" var="s" varStatus="status">
							<tr id="shop${s.sid}">
								<th scope="row"><label class="checked-label"><input
										type="checkbox" id="checkbox${s.sid }"
										onclick="click1(this.checked,${s.sid})"><i></i>
										<div class="img">
											<img src="images/temp/${shop_img[status.index] }" alt="" class="cover">
										</div> </label></th>
								<td>
									<div class="name ep3"><a  href="ToItemShowServlet?temp=one&ccid=${s.clothes.ccid}">${s.clothes.cname }</a></div>
									<div class="type c9">颜色分类：${s.clothes.ccolor}
										尺码：${s.clothes.csize }</div>
								</td>
								<td>¥${s.clothes.cprice }</td>
								<td>
									<div class="cart-num__box">
										<input type="button" class="sub" value="-"
											onclick="sum1(this.value,${s.clothes.cprice},${s.sid})"  onblur="sum(this.value,${s.clothes.cprice},${s.sid})">
										<input type="text" id="shopnum${s.sid}" class="val"
											value="${s.snum}" maxlength="2"
											onblur="shopval(this.value,${s.clothes.cprice},${s.sid})"> <input
											type="button" class="add" value="+"
											onclick="sum1(this.value,${s.clothes.cprice},${s.sid})" onblur="sum(this.value,${s.clothes.cprice},${s.sid})">
									</div>
								</td>
								<td>¥<span class="prices_span" id="prices${s.sid}">${s.clothes.cprice*s.snum}</span></td>
								<td><div class="divdeletea">
										<a href="javascript:void(0)"
											onclick="deleteshop(true,${ s.sid})">删除</a>
									</div></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="user-form-group tags-box shopcart-submit pull-right">
					<input type="button" class="btn" onclick="toOrderpay()" value="提交订单"/>
				</div>
				<div class="checkbox shopcart-total">
					<label><input type="checkbox" class="check-all"
						onclick="clickall(this.checked)"><i></i> 全选</label>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)"
						onclick="deleteall(${s.sid})">删除</a>
					<div class="pull-right">
						已选商品 <span id="checkedspan">0</span> 件
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;合计（不含运费） <b class="cr">¥<span
							class="fz24" id="sumspan">${sum}</span></b>
					</div>
				</div>
				<script>
					
						$(document).ready(function(){
							var $item_checkboxs = $('.shopcart-form__box tbody input[type="checkbox"]'),
								$check_all = $('.check-all');
							// 全选
							$check_all.on('change', function() {
								$check_all.prop('checked', $(this).prop('checked'));
								$item_checkboxs.prop('checked', $(this).prop('checked'));
							});
							// 点击选择
							$item_checkboxs.on('change', function() {
								var flag = true;
								$item_checkboxs.each(function() {
									if (!$(this).prop('checked')) { flag = false }
								});
								$check_all.prop('checked', flag);
							});
							// 个数限制输入数字
							$('input.val').onlyReg({reg: /[^0-9.]/g});
							// 加减个数
							$('.cart-num__box').on('click', '.sub,.add', function() {
								var value = parseInt($(this).siblings('.val').val());
								if ($(this).hasClass('add')) {
									
									$(this).siblings('.val').val(Math.min((value += 1),99));
								} else {
									
									$(this).siblings('.val').val(Math.max((value -= 1),1));
								}
							});
						});
					</script>
			</form>
		</div>
		</section>
	</div>
	<!-- 右侧菜单 -->
	<div class="right-nav">
		<ul class="r-with-gotop">
			<li class="r-toolbar-item"><a href="personal.jsp"
				class="r-item-hd"> <i class="iconfont icon-user" data-badge="0"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">用户中心</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="ShopCartServlet?flag=index"
				class="r-item-hd"> <i class="iconfont icon-cart"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">购物车</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="user_collectionServlet"
				class="r-item-hd"> <i class="iconfont icon-aixin"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">我的收藏</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="QueryPhone.jsp" class="r-item-hd"> <i
					class="iconfont icon-liaotian"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">查询手机号</span>
					</div>
			</a></li>
			<li class="r-toolbar-item"><a href="baidumap.jsp"
				class="r-item-hd"> <i class="iconfont icon-liuyan"></i>
					<div class="r-tip__box">
						<span class="r-tip-text">百度地图</span>
					</div>
			</a></li>
			<li class="r-toolbar-item to-top"><i class="iconfont icon-top"></i>
				<div class="r-tip__box">
					<span class="r-tip-text">返回顶部</span>
				</div></li>
		</ul>
		<script>
			$(document).ready(function() {
				$('.to-top').toTop({
					position : false
				})
			});
		</script>
	</div>
	<!-- 底部信息 -->
	<div class="footer">
		<div class="footer-tags">
			<div class="tags-box inner">
				<div class="tag-div">
					<img src="images/icons/footer_1.gif" alt="厂家直供">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_2.gif" alt="一件代发">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_3.gif" alt="美工活动支持">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_4.gif" alt="信誉认证">
				</div>
			</div>
		</div>
		<div class="footer-links inner">
			<dl>
				<dt>XXX</dt>
				<a href="temp_article/udai_article10.html"><dd>企业简介</dd></a>
				<a href="temp_article/udai_article11.html"><dd>加入U袋</dd></a>
				<a href="temp_article/udai_article12.html"><dd>隐私说明</dd></a>
			</dl>
			<dl>
				<dt>服务中心</dt>
				<a href="temp_article/udai_article1.html"><dd>售后服务</dd></a>
				<a href="temp_article/udai_article2.html"><dd>配送服务</dd></a>
				<a href="temp_article/udai_article3.html"><dd>用户协议</dd></a>
				<a href="temp_article/udai_article4.html"><dd>常见问题</dd></a>
			</dl>
			<dl>
				<dt>新手上路</dt>
				<a href="temp_article/udai_article5.html"><dd>如何成为代理商</dd></a>
				<a href="temp_article/udai_article6.html"><dd>代销商上架教程</dd></a>
				<a href="temp_article/udai_article7.html"><dd>分销商常见问题</dd></a>
				<a href="temp_article/udai_article8.html"><dd>付款账户</dd></a>
			</dl>
		</div>
		<div class="copy-box clearfix">
			<ul class="copy-links">
				<a href="agent_level.html"><li>网店代销</li></a>
				<a href="class_room.html"><li>U袋学堂</li></a>
				<a href="udai_about.html"><li>联系我们</li></a>
				<a href="temp_article/udai_article10.html"><li>企业简介</li></a>
				<a href="temp_article/udai_article5.html"><li>新手上路</li></a>
			</ul>
			<!-- 版权 -->
			<p class="copyright">
				© 2005-2017 XXX 版权所有，并保留所有权利<br>
				ICP备案证书号：闽ICP备XXX号-2&nbsp;&nbsp;&nbsp;&nbsp;福建省宁德市XXX&nbsp;&nbsp;&nbsp;&nbsp;Tel:
				XXX&nbsp;&nbsp;&nbsp;&nbsp;E-mail: XXX@qq.com
			</p>
		</div>
	</div>
</body>
</html>
